package com.sghd.fight.module.facade;

import com.sghd.common.socket.anno.InBody;
import com.sghd.common.socket.anno.InSession;
import com.sghd.common.socket.anno.SocketCommand;
import com.sghd.common.socket.anno.SocketModule;
import com.sghd.common.socket.core.ResultCallback;
import com.sghd.common.socket.session.Session;
import com.sghd.fight.net.SocketEnum;
import com.sghd.pojo.fight.game.ConnReq;
import com.sghd.pojo.fight.game.Result;
import com.sghd.pojo.fight.game.RoomType;

import java.util.Set;

import static com.sghd.common.socket.session.SessionKeys.IDENTITY;

/**
 * @author frank
 * @date 2018-10-29 9:46
 * @desc
 **/
@SocketModule
public interface GameFacade {

    @SocketCommand(SocketEnum.CONN)
    public void conn(Session session, ConnReq req, ResultCallback<Result<String>> callback);

    @SocketCommand(SocketEnum.MATCH)
    public void match(@InSession(IDENTITY) Long playerId, @InBody("type") RoomType type, @InBody(value = "bigLevel") int bigLevel, @InBody(value = "level") int level, ResultCallback<Result<Boolean>> callback);

    @SocketCommand(SocketEnum.CANCEL_MATCH)
    public void cancelMatch(@InSession(IDENTITY) Long playerId);

    @SocketCommand(SocketEnum.READY)
    public void ready(@InSession(IDENTITY) Long playerId, ResultCallback<Result<String>> callback);

    @SocketCommand(SocketEnum.MOVE)
    public void move(@InSession(IDENTITY) Long playerId, @InBody("first") int first, @InBody("second") int second, ResultCallback<Result<String>> callback);

    @SocketCommand(SocketEnum.EXECUTE_SKILL)
    public void execute(@InSession(IDENTITY) Long playerId, @InBody("skillId") int skillId, ResultCallback<Result<Object>> callback);

    @SocketCommand(SocketEnum.TEST)
    public void test(@InSession(IDENTITY) Long playerId, ResultCallback<Object> callback);

    @SocketCommand(SocketEnum.TIME)
    public void time(@InSession(IDENTITY) Long playerId, ResultCallback<Object> callback);

    @SocketCommand(SocketEnum.END_TRUSTEE)
    public void endTrustee(@InSession(IDENTITY) Long playerId, ResultCallback<Result<String>> callback);

    @SocketCommand(SocketEnum.RECONN)
    public void reconn(@InSession(IDENTITY) Long playerId, ResultCallback<Result<Object>> callback);

    @SocketCommand(SocketEnum.RESET_SKILL)
    public void resetSkill(@InSession(IDENTITY) Long playerId, Set<Integer> keeps);

    @SocketCommand(SocketEnum.MATCH_READY)
    public void matchReady(@InSession(IDENTITY) Long playerId);


}
